﻿using System;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace HRM
{
    public partial class frmProposeReport : DockContent
    {
            
        string _month;
        string _year;
        string _ReportType;
        string _ReportText;
       
        public string ReportText
        {
            get { return _ReportText; }
            set { _ReportText = value; }
        }
        public string ReportType
        {
            get { return _ReportType; }
            set { _ReportType = value; }
        }
        public string Month
        {
            get { return _month; }
            set { _month = value; }
        }
        public string Year
        {
            get { return _year; }
            set { _year = value; }
        }

        public frmProposeReport()
        {
            InitializeComponent();
            LoadLanguage();
            this.KeyPreview = true;                        
            UISetting.LoadMonths(ref cboMonth);
            cboMonth.SelectedValue = Convert.ToUInt32(DateTime.Now.Month);
            UISetting.LoadYears(ref cboYear);
            cboYear.SelectedValue = Convert.ToUInt32(DateTime.Now.Year);
        }
        void LoadLanguage()
        {
            if (this.Tag != null)
                this.Text = UpdateUI.GetString(this.Tag.ToString());
            
            UpdateUI.Load_Panel(ref panel2);

        }
        private void btnView_Click(object sender, EventArgs e)
        {
            _month = Convert.ToString(cboMonth.SelectedValue);
            _year = Convert.ToString(cboYear.SelectedValue);           
            if (radOmDau.Checked)
                _ReportType = "Trợ cấp ốm đau";
            else if (radSauOmDau.Checked)
                _ReportType = "Trợ cấp sau ốm đau";
            else if (radThaiSan.Checked)
                _ReportType = "Trợ cấp thai sản";
            else if (radSauThaiSan.Checked)
                _ReportType = "Trợ cấp sau thai sản";
            else if (radTNLDBNN.Checked)
                _ReportType = "Trợ cấp sau TNLĐ-BNN";
            else
            {
                MessageBox.Show(UpdateUI.GetString("Chưa chọn loại báo cáo"), UIParamater.TitleProject, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            _ReportText = _ReportType + " T" + _month + "/" + _year;
            this.DialogResult = DialogResult.OK;
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
            this.DialogResult = DialogResult.Cancel;
        }

        private void frmInsuranceReport_KeyUp(object sender, KeyEventArgs e)
        {

        }

        private void cbBranch_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

    }
}
